import pandas as pd

# 读取数据
data = pd.read_csv('订单表.csv', encoding='utf-8')
print(data)

# 读取前几行
data = pd.read_csv('订单表.csv', encoding='utf-8', nrows=3)
print(data)

# 读取指定列
data = pd.read_csv('订单表.csv', encoding='utf-8', usecols=[1, 3])
print(data)

# 创建DataFrame
a = [['创意弧形沙发', 103, '棉布', 1650], 
     ['毛毛虫沙发',  216, '绒布', 2580], 
     ['布艺双人沙发', 116, '混纺', 2280], 
     ['华夫格布艺沙发', 141, '复合面料', 1580]]
data = pd.DataFrame(a, columns=['产品名称', '型号', '面料', '价格'])

# 将数据写入csv文件
data.to_csv('家具.csv', sep='\t', index=False, encoding='utf-8')
